<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      :root {
        /* 轮播的个数 */
        --s: 6;
        /* 单个 li 容器的高度 */
        --h: 36;
        /*单次动画的时长 */
        --speed: 1.5s;
      }
      .g-container {
        width: 300px;
        height: calc(var(--h) * 1px);
      }
      ul {
        display: flex;
        flex-direction: column;
        animation: move calc(var(--speed) * var(--s)) steps(var(--s)) infinite;
      }
      ul li {
        width: 100%;
        height: 36px;
        /* animation: liMove calc(var(--speed)) infinite; */
      }
      @keyframes liMove {
        0% {
          transform: translate(0, 0);
        }
        80%,
        100% {
          transform: translate(0, -36px);
        }
      }
      @keyframes move {
        0% {
          transform: translate(0, 0);
        }
        100% {
          transform: translate(0, calc(var(--s) * var(--h) * -1px));
        }
      }
    </style>
  </head>
  <body>
    <div class="g-container">
      <ul>
        <li>Lorem ipsum 1111111</li>
        <li>Lorem ipsum 2222222</li>
        <li>Lorem ipsum 3333333</li>
        <li>Lorem ipsum 4444444</li>
        <li>Lorem ipsum 5555555</li>
        <li>Lorem ipsum 6666666</li>
      </ul>
    </div>
  </body>
</html>
